An important measure of web page performance is how long it takes for a web page to be downloaded sufficiently for the web browser to start displaying the web page (or parts of it) to the user. Some measurements refer to a Time To First Byte (TTFB), which is defined as a the duration from which a user makes an HTTP request to the first byte of the page being received by the browser. Many studies have shown that this load time directly affects the user experience, revenue generated, and whether a user even bothers to view the page.
A web page typically includes the base HyperText Markup Language (HTML) and potentially a large number of resources that must be loaded so that the web page can be displayed. These resources may include client-side scripts (e.g., JavaScript), Cascading Style Sheets (CSS), and/or images that are required for the correct layout, appearance, and functioning of the web page. These resources are typically loaded by specifying them using HTML in the so-called ‘head’ of the web page. The head (delimited by <head> and </head> in the HTML) in the web page appears at the start of the HTML of the web page. The web browser fetches these resources as soon as the head arrives (that is, the web browser typically does not wait until the entire page is delivered to fetch these resources). The resources in the head of the web page should be delivered as quickly as possible so that these resources can be fetched in parallel with the arrival of the rest of the page (which also may include client-side scripts, images, etc.). The head may also specify Domain Name System (DNS) names that the browser uses to look up in parallel to ensure that they are ready for page navigation.
It is also the case that at least part of the head is often unchanging from page load to page load for an individual URL. It is common for the head to be generated by a CMS or web server from a common file or program that outputs the list of resources that need to be reloaded. Thus some number of bytes from the start of the web page will be unchanging if the page is reloaded.
Many common web browsers include technology called a “service worker” that can be registered for any domain name and act as a proxy for all requests made for that domain. For example, a service worker could register for example.com (the first time that the browser visits example.com) and remain resident in the browser such that subsequent network requests to example.com are controlled by the service worker thereby placing the service worker conceptually between the rendering engine and the network.